-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
BUG-24408 Series.dt does not maintain own copy of index #24426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report
@@ Coverage Diff @@
## master #24426 +/- ##
==========================================
+ Coverage 92.3% 92.3% +<.01%
==========================================
Files 163 163
Lines 51954 51953 -1
==========================================
Hits 47957 47957
+ Misses 3997 3996 -1
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #24426 +/- ##
==========================================
- Coverage 92.3% 92.3% -0.01%
==========================================
Files 163 163
Lines 51966 51965 -1
==========================================
- Hits 47967 47966 -1
Misses 3999 3999
Continue to review full report at Codecov.
|
@@ -485,6 +485,13 @@ def test_dt_accessor_invalid(self, ser): | |||
ser.dt | |||
assert not hasattr(ser, 'dt') | |||
|
|||
def test_dt_accessor_updates_on_inplace(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you test this for the other accessors as well. I think you can assert that the result.index is not the s.index to test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can leave this test and add some in pandas/series/test_api.py
lgtm. ping on green. |
@jreback green |
thanks! |
git diff upstream/master -u -- "*.py" | flake8 --diff
Previously, the
dt
accessor maintains its own copy of the index, so in-place operations would cause the indexes to be out of sync. This PR changes the accessor so it just gets the index from its parent.